From 6dd26176b684de6e16296d78660f35fe5c150e8d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 30 May 2022 20:44:17 +0200 Subject: [PATCH] fw4: fix logic flaw in testing hw flow offloading support The revised logic failed to account for cases where zero offload capable devices where resolved, in this case the capability check was not performed at all. Fixes: #9935 Fixes: 57984e0 ("fw4: always resolve lower flowtable devices") Signed-off-by: Jo-Philipp Wich --- root/usr/share/ucode/fw4.uc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/root/usr/share/ucode/fw4.uc b/root/usr/share/ucode/fw4.uc index 02341cb..be347d7 100644 --- a/root/usr/share/ucode/fw4.uc +++ b/root/usr/share/ucode/fw4.uc @@ -462,17 +462,15 @@ return { for (let device in zone.related_physdevs) push(devices, ...resolve_lower_devices(devstatus, device, true)); - if (length(devices)) { - devices = sort(uniq(devices)); + devices = sort(uniq(devices)); - if (nft_try_hw_offload(devices)) - return devices; + if (length(devices) && nft_try_hw_offload(devices)) + return devices; - this.warn('Hardware flow offloading unavailable, falling back to software offloading'); - this.state.defaults.flow_offloading_hw = false; + this.warn('Hardware flow offloading unavailable, falling back to software offloading'); + this.state.defaults.flow_offloading_hw = false; - devices = []; - } + devices = []; } for (let zone in this.zones()) -- 2.30.2